feat(app): add vcr app remove command [APIAPEX-2823]#82
Merged
Conversation
88a306e to
21b0957
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new vcr app delete <applicationID> [--yes|-y] subcommand that deletes a Vonage application through a new DeleteVonageApplication method on the deployment API client. The command mirrors the confirmation-prompt pattern used by vcr instance remove and vcr secret remove, and ships with table-driven unit tests and a regenerated DeploymentInterface mock.
Changes:
- New
DeleteVonageApplicationmethod onDeploymentClient/DeploymentInterface(DELETE/applications/{id}, returns nil on 404). - New
vcr/app/delete/package implementingNewCmdAppDeletewith--yesflag, spinner, and survey-driven confirmation, plus tests. - Registered the subcommand in
vcr/app/app.go, updated its help/examples, and regeneratedtestutil/mocks/factory.go(also reorders some existingDatastoremocks).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/api/deployment.go | Adds DeleteVonageApplication HTTP DELETE method; treats 404 as success. |
| pkg/cmdutil/factory.go | Extends DeploymentInterface with DeleteVonageApplication. |
| testutil/mocks/factory.go | Regenerated mock for the new method; also reorders ListInstances/ListLogsByInstanceID. |
| vcr/app/delete/delete.go | New command implementation with confirmation prompt and spinner. |
| vcr/app/delete/delete_test.go | Table-driven tests for happy-path, prompt-abort, missing-arg, and API error. |
| vcr/app/app.go | Registers the new subcommand and updates the help text and examples. |
| docs/superpowers/specs/2026-05-18-vcr-app-delete-design.md | Design doc for the new command. |
| docs/superpowers/plans/2026-05-18-vcr-app-delete.md | Step-by-step implementation plan. |
Files not reviewed (1)
- testutil/mocks/factory.go: Language not supported
…and secret [APIAPEX-2823]
a3e5b46 to
aa6e115
Compare
- Return ErrNotFound on 404 in DeleteVonageApplication (was silently nil) - Handle ErrNotFound in runRemove with descriptive user-facing error - Use url.PathEscape for application ID in URL construction - Add TestDeleteVonageApplication with 204/404/500 cases - Fix err shadowing in remove_test.go (ExecuteC result was discarded) - Only register mock expectations when Times > 0
joscabmar
approved these changes
May 18, 2026
valdemarpereira-vonage
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vcr app remove <applicationID> [--yes|-y]command to remove a Vonage applicationvcr instance removeandvcr secret removeDeleteVonageApplicationtoDeploymentClientandDeploymentInterfaceChanges
pkg/api/deployment.go— newDeleteVonageApplicationmethod (idempotent DELETE, returns nil on 404)pkg/cmdutil/factory.go— method added toDeploymentInterfacetestutil/mocks/factory.go— regenerated viago generatevcr/app/remove/remove.go— command implementationvcr/app/remove/remove_test.go— 5 table-driven test casesvcr/app/app.go— subcommand registered, help text and examples updatedUsage
Testing
All 24 test packages pass (
go test ./...).Jira: APIAPEX-2823